from ssh_devicelist import devicelist
from ssh_client import *
from ssh_config_bkp import *

for device in range(len(devicelist)):
    plat = devicelist[device]['platform']
    name1 = devicelist[device]['name']
    ip1 = devicelist[device]['ip']
    username1 = devicelist[device]['username']
    password1 = devicelist[device]['password']
    if plat == 'IOS':
        running = cisco(ip1, username1, password1)
    elif plat == 'VRP':
        running = huawei(ip1, username1, password1)

    config_bkp(name1, running)
else:
    print('=' * 80)
    print('Mission accomplished.')
    print('=' * 80)

